import { Component, OnInit } from '@angular/core';
import { HeroService } from 'src/app/service/hero.service';

@Component({
  selector: 'app-hero-search',
  templateUrl: './hero-search.component.html',
  styleUrls: ['./hero-search.component.scss']
})
export class HeroSearchComponent implements OnInit {

  constructor(
    private heroService: HeroService
  ) { }

  ngOnInit() {
  }
  search(query: string) {
    this.heroService.searchHero(query).subscribe()
  }
}
